package com.atguigu.listenter;


import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;



@Component
public class MyMessageListener {
    @RabbitListener(queues = {"atguigu.queue.simple"})
    public void processMessage(String messageContent, Message message, Channel channel){
        System.out.println("messageContent = " + messageContent);
    }

    @RabbitListener(queues = {"atguigu.queue.work"})
    public void processMessageWork(String messageContent,Message message,Channel channel){
        System.out.println("messageContent = " + messageContent);
    }

    @RabbitListener(queues = {"atguigu.queue.fanout01"})
    public void processMessage01(String msg ,Message message,Channel channel){
        System.out.println("msg1 = " + msg);
    }
    @RabbitListener(queues = {"atguigu.queue.fanout02"})
    public void processMessage02(String msg ,Message message,Channel channel){
        System.out.println("msg2 = " + msg);
    }
    @RabbitListener(queues = {"atguigu.queue.message"})
    public void processMessageTopic01(String msg ,Message message,Channel channel){
        System.out.println("msg1 = " + msg);
    }
    @RabbitListener(queues = {"atguigu.queue.order"})
    public void processMessageTopic02(String msg ,Message message,Channel channel){
        System.out.println("msg2 = " + msg);
    }


}
